package a.e.b.a;

import a.e.b.b.a;
import a.e.b.b.ab;
import a.e.b.b.t;
import a.e.b.b.v;
import a.g.f;
import a.h.dc;
import a.h.wc;
import a.i.n;
import a.j.g;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

import java.util.Properties;

public class hb
  implements v
{
  public static final String a = "y.io.graphml.graph2d.PostprocessorInputHandler.IGNORE_POSTPROCESSOR_ERRORS";
  public static boolean b;
  
  public boolean a(NamedNodeMap paramNamedNodeMap)
  {
    Node localNode = paramNamedNodeMap.getNamedItem("yfiles.type");
    if (localNode == null) {
      return false;
    }
    if (!i.i) {
      if (!"postprocessors".equals(localNode.getNodeValue())) {
        return false;
      }
    }
    return true;
  }
  
  String a(Node paramNode, String paramString)
  {
    boolean bool = i.i;
    NamedNodeMap localNamedNodeMap = paramNode.getAttributes();
    if (!bool) {
      if (localNamedNodeMap == null) {
        return null;
      }
    }
    Node localNode = localNamedNodeMap.getNamedItem(paramString);
    if (!bool) {
      if (localNode == null) {
        return null;
      }
    }
    return localNode.getNodeValue();
  }
  
  public void a(t paramt, Node paramNode)
    throws a
  {
    boolean bool = i.i;
    int i = i.h;
    g localg = (g)paramt.d();
    Node localNode1 = paramNode.getFirstChild();
    if (localNode1 != null) {}
    label342:
    label629:
    while (bool)
    {
      if ("Postprocessors".equals(localNode1.getLocalName())) {}
      while (bool)
      {
        Node localNode2 = localNode1.getFirstChild();
        do
        {
          if (localNode2 == null) {
            break label685;
          }
          if (i != 0) {
            break;
          }
          if ("Processor".equals(localNode2.getLocalName()))
          {
            String str1 = a(localNode2, "class");
            Object localObject1;
            if ((bool) || (str1 == null))
            {
              localObject1 = "<y:Processor >: attribute \"class\" missing";
              if (!bool)
              {
                if (y.a(paramt, "y.io.graphml.graph2d.PostprocessorInputHandler.IGNORE_POSTPROCESSOR_ERRORS")) {
                  n.a((String)localObject1 + ", ignoring Postprocessor");
                }
              }
              else
              {
                if (bool) {
                  continue;
                }
                if (i == 0) {
                  break label671;
                }
              }
              throw new a((String)localObject1);
            }
            else
            {
              localObject1 = null;
              Object localObject2;
              try
              {
                localObject1 = (f)Class.forName(str1).newInstance();
              }
              catch (Exception localException)
              {
                localObject2 = "Error creating Postprocessor instance: " + localException.getMessage();
                if (!bool)
                {
                  if (y.a(paramt, "y.io.graphml.graph2d.PostprocessorInputHandler.IGNORE_POSTPROCESSOR_ERRORS")) {
                    n.a((String)localObject2 + ", ignoring Postprocessor");
                  }
                }
                else
                {
                  if (bool) {
                    continue;
                  }
                  if (i == 0) {
                    break label671;
                  }
                }
                throw new a((String)localObject2, localException);
              }
              catch (NoClassDefFoundError localNoClassDefFoundError)
              {
                localObject2 = "Error creating Postprocessor instance: " + localNoClassDefFoundError.getMessage();
                if (!bool)
                {
                  if (!y.a(paramt, "y.io.graphml.graph2d.PostprocessorInputHandler.IGNORE_POSTPROCESSOR_ERRORS")) {
                    break label342;
                  }
                  n.a((String)localObject2 + ", ignoring Postprocessor");
                }
                if (bool) {
                  continue;
                }
              }
              if (i != 0)
              {
                throw new a((String)localObject2, localNoClassDefFoundError);
                dc localdc = ((f)localObject1).i();
                if (bool) {
                  continue;
                }
                while (localdc != null)
                {
                  localObject2 = new Properties();
                  String str2 = localdc.e() + '.';
                  Node localNode3 = localNode2.getFirstChild();
                  do
                  {
                    if (localNode3 == null) {
                      break;
                    }
                    if (i != 0) {
                      break label662;
                    }
                    if ("Option".equals(localNode3.getLocalName()))
                    {
                      String str3 = a(localNode3, "name");
                      String str4 = a(localNode3, "value");
                      String str5;
                      if (!bool) {
                        if (str3 == null)
                        {
                          str5 = "Error parsing Postprocessor options: No option name defined";
                          if (!bool)
                          {
                            if (y.a(paramt, "y.io.graphml.graph2d.PostprocessorInputHandler.IGNORE_POSTPROCESSOR_ERRORS")) {
                              n.a(str5 + ", ignoring option");
                            }
                          }
                          else
                          {
                            if (bool) {
                              continue;
                            }
                            if (i == 0) {
                              break label629;
                            }
                          }
                          throw new a(str5);
                        }
                      }
                      if (!bool) {
                        if (str4 == null)
                        {
                          str5 = "Error parsing Postprocessor options: No option value defined";
                          if (!bool)
                          {
                            if (y.a(paramt, "y.io.graphml.graph2d.PostprocessorInputHandler.IGNORE_POSTPROCESSOR_ERRORS")) {
                              n.a(str5 + ", ignoring option");
                            }
                          }
                          else
                          {
                            if (bool) {
                              continue;
                            }
                            if (i == 0) {
                              break label629;
                            }
                          }
                          throw new a(str5);
                        }
                      }
                      ((Properties)localObject2).setProperty(str2 + str3, str4);
                    }
                    localNode3 = localNode3.getNextSibling();
                  } while (i == 0);
                  if (!bool)
                  {
                    localdc.b(new wc((Properties)localObject2));
                    a((f)localObject1, localg, paramt);
                  }
                }
              }
            }
          }
          localNode2 = localNode2.getNextSibling();
        } while (i == 0);
        localNode1 = localNode1.getNextSibling();
      }
      if (i == 0) {
        break;
      }
    }
    label662:
    label671:
    label685:
    return;
  }
  
  protected void a(f paramf, g paramg, t paramt)
    throws a
  {
    try
    {
      paramf.b(paramg);
    }
    catch (Exception localException)
    {
      String str = "Error executing Postprocessor " + localException.getMessage();
      if (!i.i)
      {
        if (y.a(paramt, "y.io.graphml.graph2d.PostprocessorInputHandler.IGNORE_POSTPROCESSOR_ERRORS")) {
          n.a(str);
        }
      }
      else if (i.h == 0) {
        return;
      }
      throw new a(str);
    }
  }
  
  public ab a()
  {
    return ab.g;
  }
  
  public void a(t paramt) {}
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.b.a.hb

 * JD-Core Version:    0.7.0.1

 */